package com.yqw.onlineDocs.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yqw.onlineDocs.model.dto.documentVersion.DocumentVersionQueryRequest;
import com.yqw.onlineDocs.model.entity.DocumentVersion;
import com.yqw.onlineDocs.model.vo.DocumentVersionVO;

import javax.servlet.http.HttpServletRequest;

/**
 * 文档版本历史服务
 *
 */
public interface DocumentVersionService extends IService<DocumentVersion> {

    /**
     * 校验数据
     *
     * @param documentVersion
     * @param add             对创建的数据进行校验
     */
    void validDocumentVersion(DocumentVersion documentVersion, boolean add);

    /**
     * 获取查询条件
     *
     * @param documentVersionQueryRequest
     * @return
     */
    QueryWrapper<DocumentVersion> getQueryWrapper(DocumentVersionQueryRequest documentVersionQueryRequest);

    /**
     * 获取文档版本历史封装
     *
     * @param documentVersion
     * @param request
     * @return
     */
    DocumentVersionVO getDocumentVersionVO(DocumentVersion documentVersion, HttpServletRequest request);

    /**
     * 分页获取文档版本历史封装
     *
     * @param documentVersionPage
     * @param request
     * @return
     */
    Page<DocumentVersionVO> getDocumentVersionVOPage(Page<DocumentVersion> documentVersionPage,
                                                     HttpServletRequest request);
}
